Skip to main content
POST
/
api
/
portrait
/
effects
/
hairstyle-editor
Hairstyle changer
curl --request POST \
  --url https://www.ailabapi.com/api/portrait/effects/hairstyle-editor \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form image_target='@example-file' \
  --form 'hair_type=<string>'
{
  "request_id": "",
  "log_id": "",
  "error_code": 0,
  "error_code_str": "",
  "error_msg": "",
  "error_detail": {
    "status_code": 200,
    "code": "",
    "code_message": "",
    "message": ""
  },
  "data": {
    "image": ""
  }
}

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
image_target
file
hair_type
string

Hairstyle type.

  • 101: Bangs (default)
  • 201: Long hair
  • 301: Bangs with long hair
  • 401: Medium hair increase
  • 402: Light hair increase
  • 403: Heavy hair increase
  • 502: Light curling
  • 503: Heavy curling
  • 603: Short hair (requires input size < 2048x2048; if the input is larger than 2048x2048, the output image will be resized to a maximum of 2048 on the longest side.)
  • 801: Blonde
  • 901: Straight hair
  • 1001: Oil-free hair (slight effect, recommended for images with noticeable issues)
  • 1101: Hairline fill (slight effect, recommended for images with noticeable issues of a high hairline)
  • 1201: Smooth hair (slight effect, recommended for images with a large hairstyle area)
  • 1301: Fill hair gap (slight effect, fills the scalp part in the hair area, recommended for images with noticeable issues)
  • Response

    200 - application/json

    Success

    The response is of type object.